<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('assistant_ranks', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('user_id')->comment('助教ID');
            $table->bigInteger('store_id')->comment('门店ID');
            $table->integer('total_minutes')->default(0)->comment('总时长');
            $table->integer('total_assistant_minutes')->default(0)->comment('总陪打时长');
            $table->integer('total_inner_virtual_minutes')->default(0)->comment('总内虚假时长');
            $table->integer('total_outer_virtual_minutes')->default(0)->comment('总内虚假时长');
            $table->integer('total_assistant_count')->default(0)->comment('总陪打次数');
            $table->integer('total_point')->default(0)->comment('总积分');
            $table->date('count_date')->comment('统计日期');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('assistant_ranks');
    }
};
